package com.thiswhyme.republish.common;

/**
 * @description: redis key常量
 * @author: thiswhyme
 * @date: 2021/3/22
 */
public class RedisKey {

    /**
     * 待ack消息中缀
     */
    public static final String TO_ACK_ZEST = "to_ack_zset";

    /**
     * 待重发消息中缀
     */
    public static final String TO_REPUBLISH_ZEST = "to_republish_zset";

    /**
     * 消息迁移锁中缀
     */
    public static final String MESSAGE_TRANSFER_LOCK = "message_transfer_lock";

    /**
     * 根据后缀组装key
     * @param applicationName 服务名
     * @param suffix 后缀
     * @return
     */
    public static String genKey(String applicationName, String suffix) {
        return new StringBuilder().append(applicationName).append(":").append(suffix).toString();
    }
}
